import Vue from 'vue'
import VueRouter from 'vue-router'
import Canvas from '../views/Canvas.vue'
import NodeDetail from '../views/NodeDetail.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Canvas',
    component: Canvas
  },
  {
    path: '/node/:id',
    name: 'NodeDetail',
    component: NodeDetail,
    props: true
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router